﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeepZoomPivotConstructor.VisualLib.Hotspots
{
    /// <summary>
    /// Base class for a hotspot. This is sealed because there are if statements in
    /// the DZ code that look for this particular class.
    /// </summary>
    public sealed class VisualHotSpot : VisualBasicSingleImage
    {
        public VisualHotSpot(double width, double height)
        {
            _width = width;
            _height = height;

            Actions = new List<HotSpotActionBase>();
        }

        /// <summary>
        /// Adds an action into the hotspot.
        /// </summary>
        /// <param name="action"></param>
        public void Add(HotSpotActionBase action)
        {
            Actions.Add(action);
        }

        /// <summary>
        /// We aren't actually "real" in the sense that we actuall generate
        /// a JPEG or anythign that can be rendered.
        /// </summary>
        public override List<SceneGraphSceneNode> SGNodeList
        {
            get { return new List<SceneGraphSceneNode>(); }
        }

        /// <summary>
        /// An internal list of actions that are associated with this
        /// area.
        /// </summary>
        private List<HotSpotActionBase> Actions { get; set; }

        /// <summary>
        /// Loop over the actions, extracting the action data.
        /// </summary>
        /// <param name="cb"></param>
        public void GetAllActoinData (Action<HotSpotActionBase> cb)
        {
            Actions.ForEach(cb);
        }
    }
}
